Blog migration-I have migrated my blog to www.ijavaboy.com to better manage it. We are sorry for the inconvenience caused by no updates! New address of this article: Click me
In this article, we will write how launcher achieves the drag and drop of items on the desktop in Android. After studying its mechanism, the brain suddenly gets angry and wants to implement
Launcher is our home, which can be simply understood as a simplified Linux GUI. As a GUI, it must first complete its most essential functions,That is, it must be able to provide categing to all applications (category_launcher). However, as a GUI, it must not only be a good score, but also be a beautiful girl (wallpaper );In addition, it must be highly interactive. If there is no good interaction, just like you have been paying attention to a beauty fo
Blog migration-I have migrated my blog to www.ijavaboy.com to better manage it. We are sorry for the inconvenience caused by no updates! New address of this article: Click me
With the previous work, the desktop is basically ready to use, but it is far from the launcher that comes with the system. Among them, the items on the system launcher's desktop can be free
Recently, the application just needs to add shortcuts. After referring to the source code and some other information on the Internet, it is done.
There were two problems at the same time,
1. After the program is uninstalled, the desktop shortcut still exists:
For this question, the old or current version of many online applications still exists. after referring to the source code, I found a solution: when creating the export cut, you need to set the e
get down to the truth. If we want to write the same launcher ourselves, we have to look at the simulator or the Android system first, so that we can look at this simple but hidden starter that starts the first one each time. Through some tossing, You can roughly divide the functions implemented by launcher into the following:
1. Long-pressed in an empty position
no space is found, the system prompts the user that the screen does not have enough space to accommodate.
With the above analysis, the following describes how launcher completes each step.
When the user presses the desktop for a long time, the motion_down event is passed to celllayout. In the onintercepttouchevent method of celllayout, the user determines whether the current long press is in a blank area.
shortcut. * @param parent The group the shortcut belongs to. * @param info The data structure describing the shortcut. * * @return A View inflated from layoutResId. */ View createShortcut(int layoutResId, ViewGroup parent, ShortcutInfo info) { TextView favorite = (TextView) mInflater.inflate(layoutResId, parent, false); favorite.setCompoundDrawablesWithIntrinsicBounds(null, new FastBitmapDrawable(info.getIcon(mIconCache)), null,
1. Introduction to favorites on the desktop
The launcher desktop has four elements in the middle, which are the window widgets of a clock. The following lines are respectively a camera, an Amazon bookmarks, and a folder (the folder contains settings and clock ).
In the code, they are all favorites: appwidget, application, shortcut, and folder.2. view the databas
I. Preface:Init process –> zygote process –> systemserver process –> Launcher Desktop program-our appInit process: Linux root process, Android system is based on Linux system, so it can be counted as the first process of the entire Android operating system;Zygote process: Root process of
Hello everyone, today I want to share with you the development of the launcher desktop shortcut icon. We all know that the shortcut icon consists of two parts: the application icon and the Application name. In fact, the shortcut icon in launcher only inherits the textview control and re-draws it to make the background light gray (I don't know what the color is) t
(11) Android Launcher customization: 4.4 latest desktop single-layer, dual-layer switch function, androidlauncher
Recently, it took a few nights to import the latest 4.4 desktop to eclipse and fixed some errors. It can finally run.
It is found that the single screen code on 4.4luancher has changed.
Find it and confi
Recently introduced the latest 4.4 desktop to eclipse spent a few nights, fix some error. Finally can run.The code for single found on 4.4luancher has changed.Find the next, more convenient in the launcherappstate inside, configuration can be.Can be single or double-layer switching.public static Boolean Isdisableallapps () {Returns false on Non-dogfood builds.Return getinstance (). Mbuildinfo.isdogfoodbuild () Launcher.ispropertyenabled (Launcher.disa
Blog migration-I have migrated my blog to www.ijavaboy.com to better manage it. We are sorry for the inconvenience caused by no updates! New address of this article: Click me
Originally, this article should still write the implementation principle of the item drag in launcher. However, since studying launcher, it has not been implemented before, and now it is all inspired. This is not the case. A month ago
, in onmeasure, You can naturally see that when you measure the size of each child, the set method is also called for it. As follows:
Int COUNT = getchildcount (); log. V (TAG, "onmeasure start... "); For (INT I = 0; I
At this point, we have finished introducing the child's painting work on celllayout. But we have not mentioned how to add the selected item to the desktop when we press the desktop for a lon
A shortcut icon consists of two parts: the application icon and the Application name. In fact, the shortcut icon in launcher only inherits the textview control and re-draws it to make the background light gray (I don't know what the color is) the elliptical background, the displayed text color is white. Textview has the Android: drawabletop; drawablebottom (not all of them are written here) attribute to dis
Let's briefly talk about the principle of widgets. Widgets are a piece of information displayed on the desktop. You can also click widgets to jump to a program. The system comes with a program. The typical widget is music. This android built-in music playing applet. This is a typical widget + app application. A program can be started either through a widget or through an app. Widget is an appwidgetprovider
The most appealing thing about Android phones is its open source and the pleasure of other third-party apps. Experimenting with windows on Android phones is an exploration project for some mobile enthusiasts, whether remotely controlled or virtual, and there is a new way to do it. Today's small series to introduce a copy of the Desktop XP
Recently I have studied lancher, from the text message MMS framework to the bug and demand modification of launcher. Next I will explain the layout of the simplest home screen program of launcher, it gives readers a sense of getting started. The main screen of Android is divided into five screens, which are 0, 1, 2, 3, and 4 from left to right. So which programs
: packagename = " Com. apical. Radio " // Package name of the application Launcher: screen = " 1 " // 1st screens and 5 0-4 screens Launcher: x = " 0 " // Position X of the icon. The first value in the upper left corner is 0, which increments to the left. Five values are displayed in total: 0-4. L0auncher: Y = " 0 " // The Y position of the icon. The first one in the upper left corner is 0, w
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.